<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>提现账户</title>  <link rel="icon" href="/template/pc1/images/wmh_favicon.ico" type="image/x-icon" />
    <meta name="Author" content="Meida Team"/>
    <meta name="Copyright" content="Meida"/>
    <link rel="icon" href="/template/pc1/images/wmh_favicon.ico" type="image/x-icon"/>
    <% include("include.html"){}%>
    <link href="/template/pc1/css/login.css" rel="stylesheet" type="text/css"/>
    <link href="/template/pc1/css/register.css" rel="stylesheet" type="text/css"/>
    <link href="/template/pc1/css/member_center.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="/template/pc1/js/login.js"></script>
    <script type="text/javascript" src="/template/pc1/js/register.js"></script>
    <style type="text/css">
        .tixian {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            border-bottom: 1px solid #eeeeee;
            padding-left: 40px;
            font-size: 18px;
        }

        .tixian > li {
            padding: 10px;
            position: relative;
            width: 100px;
            cursor: pointer;
        }

        .tixian > li.active:after {

            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            width: 100px;
            border-bottom: 1px solid #15abf3;
            content: '';
        }

        .tixian > li.active {
            color: #15abf3;
        }

        .hidden {
            display: none;
        }
    </style>
</head>
<body class="memberCenter">
<%include("header_index_sys.html"){}%>
<div class="body passwordInput">
    <div class="bodyLeft">
        <div class="memberInfo">
            <div class="top"></div>
            <div class="middle">
                <p>欢迎您！<span class="username">${loginMember.username}</span> [<a class="userLogout"
                                                                                 href="/memberCenter/logout">退出</a>]</p>
                <p>会员等级:<span class="red"> ${loginMember.memberRank.name!}</span></p>
            </div>
            <div class="bottom"></div>
        </div>
        <div class="blank"></div>
        <!-- 侧边栏 -->
        <%include("sidebar_customer.html"){}%>
    </div>
    <div class="bodyRight">
        <div class="memberCenterDetail">
            <div class="top">
                账户资产
            </div>

            <div>
                <ul style="" class="tixian">
                    <li class="active">马上提现</li>
                    <li>提现记录</li>

                </ul>
                <div id="getMoney" style="padding-left: 100px;">
                    <div style="display: flex;align-items: center;color: #909090;margin-top:20px;"><label
                            style="width: 100px ;text-align:right;margin-right:20px">提现至:</label>
                        <div style="width: 300px">
                            <select style="padding: 5px 20px" id="selectType">
                                <option>银行卡</option>
                                <option>支付宝</option>
                                <option>微信</option>
                            </select>
                        </div>
                    </div>
                    <div style="display: flex;align-items: center;color: #909090;margin-top:20px;"><label
                            style="width: 100px ;text-align:right;margin-right:20px">可用余额:</label>
                        <div style="width: 300px;display: flex;align-items: center;justify-content: space-between;font-size: 18px">
                            <label><span id="yue">${balance!0.00}</span>元</label>
                            <label style="cursor: pointer;color: #333" id="allselect">全部提现</label>
                        </div>
                    </div>
                    <div style="display: flex;align-items: center;color: #909090;margin-top:20px;"><label
                            style="width: 100px ;text-align:right;margin-right:20px">提现金额:</label>
                        <div style="width: 300px"><input class="formText" placeholder="请输入提现金额" id="needyue"/></div>
                    </div>
                    <div style="display: flex;align-items: center;color: #909090;margin-top:20px;"><label
                            style="width: 100px ;text-align:right;margin-right:20px">当前手机号:</label>
                        <div style="width: 300px">${member.phone!}</div>
                    </div>

                    <div style="display: flex;align-items: center;color: #909090;margin-top:20px;"><label
                            style="width: 100px ;text-align:right;margin-right:20px">短信验证码:</label>
                        <div style="width: 300px;display: flex;align-items: center;justify-content: space-between">
                            <input class="formText" placeholder="验证码" id="message"
                                   style="width: 180px"/>
                            <button style="width: 80px" class="submitButton" id="senCodes">获取</button>
                        </div>
                    </div>
                    <div style="text-align: left;margin-top: 40px;padding-left: 120px">

                        <button class="memberCenter submitButton" id="submit" type="button">提交</button>
                    </div>
                    <div style="margin-top: 140px;border-top: 1px solid #eee;padding-top: 40px;color: #909090">
                        <div>温馨提示</div>
                        <div style="margin-top: 10px"> 1、开通存管账户、设置交易密码、绑定银行卡后，才能进行提现操作。
                        </div>
                        <div style="margin-top: 10px"> 2、提现免手续费 。
                        </div>
                        <div style="margin-top: 10px"> 3、提现将会在审核成功后的下一个工作日到账；遇双休日、国家法定节假日，到账日期顺延。
                        </div>

                        <div style="margin-top: 10px"> 4、平台禁止洗钱、信用卡套现、虚假交易等行为，一经发现并确认，将终止该账户的使用。
                        </div>
                        <!--<div style="margin-top: 10px"> 注：若有特殊情况，最终以银行解释为准。
                        </div>-->
                    </div>
                </div>
                <div id="getMoneyDetil" class="hidden" style="padding: 20px">
                    <table class="listTable">
                        <tr>
                            <th>提现时间</th>
                            <th>提现金额</th>
                            <th>提现状态</th>
                            <th>提现方式</th>
                        </tr>


                    </table>

                </div>
            </div>
            <div class="bottom"></div>
        </div>
    </div>
    <div class="blank"></div>
</div>
<div class="blank"></div>
<%include("footer.html"){}%>
<script>
    var list = $('.tixian >li');
    var index = 0;
    $('.tixian >li').on('click', function () {
        var $this = $(this);
        $.each(list, function () {
            $(this).removeClass('active');
        });
        index = list.index($this)
        $this.addClass('active');
        if (index == 0) {
            $('#getMoney').removeClass('hidden');
            $('#getMoneyDetil').addClass('hidden');
        } else {
            $('#getMoney').addClass('hidden');
            $('#getMoneyDetil').removeClass('hidden');
        }
    });
    $('#senCodes').on('click', function () {
        var $this = $(this);
        var phone = '${member.phone!}';
        if (!phone) {
            $.tip('手机号不正确');
            return false
        }
        $.ajax({
            url: '/b/pc/balance/validateCaptcha',
            data: {
                "phone": phone,
            },
            success: function (data) {

                if (data.state === 'fail') {
                    $.tip(data.info);
                    return false;
                } else {
                    var timmer = 60;
                    $this.attr('disabled', true);
                    var phoneCodeTimer = setInterval(function () {
                        if (timmer >= 1) {
                            timmer--;
                            $this.text(timmer + " s");
                        } else {
                            $this.text('验证码');
                            window.clearInterval(phoneCodeTimer);
                            $this.removeAttr('disabled');
                        }

                    }, 1000);

                }
            }
        })

    })
    $('#allselect').on('click', function () {
        $('#needyue').val($('#yue').text())
    });
    $('#submit').on('click', function () {
        var amount = $('#needyue').val();
        var yanzhengma = $('#message').val();
        if(!yanzhengma){
            $.tip("请输入验证码");
            return false
        }
        if (10 > parseFloat(amount) || !amount) {
            $.tip("提现金额必须大于10元");
            return false
        }


        var payType = $("#selectType").get(0).selectedIndex;
        console.log(payType)

        $.ajax({
            url: "/b/pc/tocashing/save",
            data: {
                cashAmount: amount,
                bankType: payType,
                phonecode:yanzhengma

            }, success: function (data) {
                if (data.state == 'ok') {
                    $.tip(data.msg);
                    window.location.reload();
                } else {
                    $.tip(data.msg);
                }
            }
        })
    })

</script>
</body>
</html>